package com.views {
	import com.utils.LoadResponder;
	import com.utils.URI;

	public class LoginView extends Base implements IView {
		private var _first:Boolean;

		public function LoginView() {
			super();

		}

		public function show():void {
			var lr:LoadResponder = new LoadResponder(this.login, function(_arg1:String, _arg2:int):void {
				_view.showViewProcess(_arg1, _arg2);
			})
//			_view.loadResources(["InitLoading", "Alert"], lr);
			_view.loadResources(["InitLoading"], lr);
		}

		public function close():void {

		}

		public function clear():void {

		}

		private function login():void {
			_view.initLoading.show();
			var playerName:String = URI.playerName;
			var hashCode:String = URI.hashCode;
			var time:String = URI.time;
//			_data.call(Mod_Player_Base.login, this.loginCallback, [playerName, hashCode, time, URI.sourceUrl, URI.regdate]);
			loginCallback();
		}

		private function loginCallback():void {
//			switch (_ctrl.player.logined) {
//				case Mod_Player_Base.SUCCEED:
					this._first = false;
					this._view.initLoading.loadToolbar();
//					break;
//				case Mod_Player_Base.FIRST_TIME:
//					this._first = true;
//					this._view.initLoading.loadChooseRole();
//					break;
//				case Mod_Player_Base.DUPLICATED_NICKNAME:
//					trace("重复名字");
//					break;
//				case Mod_Player_Base.DISABLE_LOGIN:
//					trace("无效登录");
//					break;
//				default:
//					trace("登录失败");
//			}
		}

		public function get first():Boolean {
			return this._first;
		}

	}

}
